<?php
$section = "gallery";
$titre = _LB_GALLERY;
$link = $section;
Session::setBackLink($link);
//create cfer
$id = Request::getNumber("id");

if($id > 0){
	
	$album = new Album();
	if(!$album->get($id)){
		redirect(APPLICATION_URL_FO."/gallery/");
	}
	$album_gallery = new Album_Gallery();
	$album_gallery->ID_ALBUM = $id;
	$album_gallery->DISABLED = 0;
	$album_gallery->find();
}
else{
	$album = new Album();
	$album->DISABLED = 0;
	$album->find();
			
	
}

$cfer = new Cfer(array(
	_LB_HOME =>  APPLICATION_URL_FO,
    _LB_EVENT => APPLICATION_URL_FO."/events/"
));
Session::setBackCfer($link, $cfer->getCferArray());
$smarty->assign('cfer', $cfer);
$smarty->assign('id', $id);
$smarty->assign('album', $album);
if($id > 0){
$smarty->assign('album_gallery', $album_gallery);
}
$smarty->assign('titre', $titre);
$smarty->display("gallery.html");
?>
